-
Notifications
You must be signed in to change notification settings - Fork 1k
Hide pages and sections by adding hidden
to frontmatter
#2826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Hide pages and sections by adding hidden
to frontmatter
#2826
Conversation
b0f9158
to
ff4bfe4
Compare
…d filtered them out of Paginator
ff4bfe4
to
a80a744
Compare
@@ -112,6 +112,10 @@ weight = 0 | |||
# A draft page is only loaded if the `--drafts` flag is passed to `zola build`, `zola serve` or `zola check`. | |||
draft = false | |||
|
|||
# A hidden page is loaded and created, but won't be added to Paginators, | |||
# set to true to hide page or false to override a parent section's `hidden = true` | |||
hidden = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since hidden
is a Option<bool>
its good to default to false
right? I was thinking of leaving it empty, implying the None
state.
I assumed that people would get confused and since the None
implies false
with the inheritence rules specified above it, it should be fine!
Lemme know
hidden
to frontmatter
Hi @bram-dingelstad, I'm the initiator of the mentioned GitHub discussion, and I wanted to highlight some potential changes needed to exclude hidden pages from search:
Additional improvements:
|
Great suggestions @tuyen-at-work! I'll get to adding those when I have the time! |
This feature is implemented based on discussion on the forum as well as #2391
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one:
I've added
hidden
to bothPageFrontMatter
&SectionFrontMatter
and made sure to filter them in the Paginator, which covers my use case.Work that I can still do to bring this to completion:
Lemme know what y'all think ✨